Import('*')

env = env.Copy()

def bison_cxx_emitter(target, source, env):
    hh = target[0].name.replace(".cc",".hh")
    target = target + [hh, 'location.hh', 'position.hh', 'stack.hh']
    return (target, source)

env['BUILDERS']['BisonCxx'] = Builder(
	action = '$YACC -o $TARGET $SOURCE',
	emitter = bison_cxx_emitter,
	suffix = '.cc',
	src_suffix = '.yy'
    )

#parser_src = env.BisonCxx('ResourceParser.yy')
#env.Install(Dir('.').srcnode(), parser_src)

#parser_meta = Split("""
#	     ResourceParserDriver.cpp
#	     ResourceParser.cc 
#	     ResourceScanner.ll
#	""")

l = env.Library('SlakMesh', 
    Split("""Mesh.cpp 
	     Material.cpp 
	     Prims.cpp 
	"""))

env.Install('#lib',l)


